import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Logger {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		MessagePasser mp = new MessagePasser(args[0], "logger");

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			try {
				String input = br.readLine();
				String[] inputs = input.split(" ");
				String action = inputs[0];

				if( action.equals("d")){
					mp.dump();
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

	}

}
